package com.example.test.controller;

import com.example.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/info")
    public Object findAll() throws IOException {
      return   userService.findAll();
    }

    @GetMapping("/insert")
    public Object insert() throws IOException{
        return   userService.insert();
    }
    @GetMapping("/delete")
    public Object delete() throws IOException{
        return   userService.delete();
    }
    @GetMapping("/update")
    public Object update() throws IOException{
        return   userService.update();
    }


    @GetMapping("/getWithRole")
    public Object getWithRole() throws IOException {
        return userService.getWithRole();
    }

    @GetMapping("/findRepos")
    public Object findRepos() throws IOException {
        return userService.findRepos();
    }
}
